# ---- BASE ----
FROM node:8-alpine AS base
WORKDIR /app
COPY package*.json ./
RUN npm install

# ---- Copy Files/Build ----
FROM base AS build
COPY . /app
RUN npm run build

# --- Release with Alpine ----
FROM nginx:alpine AS release
# 创建 app 目录
WORKDIR /app
COPY --from=build /app/dist ./
COPY ./deploy/nginx.conf /etc/nginx/nginx.conf
COPY ./deploy/entrypoint.sh /tmp/
ENTRYPOINT /tmp/entrypoint.sh
